<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="content">
            <div align="center"> 
                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                </h:panelGroup>
                <h:form id="formLogin" >
                    <p:panel header="Login" style="width: 230px;">
                        <h:panelGrid columns="2">
                            <h:outputLabel value="Usuário:" for="usr" />
                            <p:inputText  value="#{loginManagedBean.login}" id="usr" style="width: 80%"
                                          required="true" requiredMessage="Necessário digitar um nome de usuário"/>
                            <h:outputLabel value="Senha:" for="pwd" />
                            <p:password value="#{loginManagedBean.senha}" feedback="false" maxlength="8" id="pwd" style="width: 80%" 
                                        required="true" requiredMessage="Necessário digitar uma senha"/>
                        </h:panelGrid>
                        <div align="center">
                            <p:commandButton id="OK" ajax="false" action="#{loginManagedBean.efetuarLogin}" value="OK" style="text-align:center; align: center" />
                        </div>
                    </p:panel>
                </h:form>
            </div>

        </ui:define>
    </ui:composition>

</html>
